<?php
/**
 * Created by PhpStorm.
 * User: tom_xia
 * Date: 2018/5/30
 * Time: 15:52
 * 热门列表
 */
require_once dirname(__DIR__ ). "/common.php";

use app\cls\tom\Response;

$page = isset($_GET["page"]) ? intval($_GET["page"]) : 1;
$page = $page > 0 ? $page : 1;
$pageSize = 10;
$materialService = new \app\service\Material();

$userService = new \app\service\User();
$userUUID = $userService->getUserUUIDByHTPPHeaderToken();
try {
    $response = $materialService->hotList($userUUID, $page, $pageSize);
    Response::outputSelf($response);
} catch (Exception $e) {
    Response::output(-1,"精选内容获取失败 msg==>".$e->getMessage());
}
